#ifndef GIFIMAGEDESCRIPTOR_H
#define GIFIMAGEDESCRIPTOR_H

#include "winggif.h"
#include <QIODevice>
#include <QObject>

namespace WingGif {

class WINGEXPORT GifImageDescriptor : public QObject {
  Q_OBJECT
  Q_PROPERTY(int left READ left)
  Q_PROPERTY(int top READ top)
  Q_PROPERTY(int width READ width)
  Q_PROPERTY(int height READ height)
  Q_PROPERTY(bool hasLocalColorTable READ hasLocalColorTable)
  Q_PROPERTY(bool interlace READ interlace)
  Q_PROPERTY(bool isLocalColorTableSorted READ isLocalColorTableSorted)
  Q_PROPERTY(int localColorTableSize READ localColorTableSize)

public:
  GifImageDescriptor(QIODevice *stream, QObject *parent = nullptr);

  int left();
  int top();
  int width();
  int height();
  bool hasLocalColorTable();
  bool interlace();
  bool isLocalColorTableSorted();
  int localColorTableSize();

private:
  int _left;
  int _top;
  int _width;
  int _height;
  bool _hasLocalColorTable;
  bool _interlace;
  bool _isLocalColorTableSorted;
  int _localColorTableSize;
};

} // namespace WingGif

#endif // GIFIMAGEDESCRIPTOR_H
